import {
  Router,
  createRouter,
  // RouteRecordRaw,
  createWebHashHistory,
} from 'vue-router';

// import { userStore } from '@/store/user.ts';

import commonRoutes from '@/router/route.ts';
// import exceptionRoute from '@/router/exception.ts';

// const routes: Array<RouteRecordRaw> = [
//   ...commonRoutes
//   ...exceptionRoute
// ];
const router: Router = createRouter({
  history: createWebHashHistory(),
  routes: commonRoutes,
});

router.beforeEach((to, from, next) => {
  console.log('to', to, from);
  next();
  // const store = userStore();
  // if (store.token) {
  //   next();
  // }
});
export default router;
